import BaseView from "../../cfw/mvc/BaseView";
import LoginController from "./LoginController";
import ModuleManager, { ModuleID } from "../../cfw/module/ModuleManager";
import SDKManager from "../../sdk/SDKManager";
import { SDKEventName, BattleID } from "../../sdk/SDKConfig";


const { ccclass, property } = cc._decorator;

@ccclass
export default class LoginView extends BaseView {



    protected controller: LoginController;

    start() {
        this.controller = LoginController.instance()
        SDKManager.getChannel().sendEvent(SDKEventName.enterlogin)
        SDKManager.getChannel().battleEnd(BattleID.ENTER_GAME)
    }

    onButtonEnterGameClick() {
        this.controller.intoLobby()
    }

    onDestroy() {
        ModuleManager.getLoader(ModuleID.LOGIN).release()
    }


}
